package com.zy.ivideo.controller;

import com.zy.ivideo.entity.PlayEntity;
import com.zy.ivideo.entity.ResponseEntity;
import com.zy.ivideo.service.PlayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/play")
@Api(value = "播放次数模块API接口", description = "该模块提供播放次数模块服务", tags = "播放次数模块")
public class PlayController {
    @Autowired
    PlayService service;

    /**
     * 同步播放次数
     *
     * @param entity
     * @return
     */

    @ApiOperation(value = "同步播放次数", notes = "同步播放次数", httpMethod = "POST")
    @PostMapping("/syncPlayNums")
    public ResponseEntity<PlayEntity> syncPlayNums(@RequestBody
                                                   @ApiParam(value = "播放次数实体", name = "entity", required = true)
                                                           PlayEntity entity) {
        return service.syncPlayNums(entity);
    }
}
